import { Router } from 'express';
import {
  sendRequest,
  acceptRequest,
  listFriends,
  listRequests,
  removeFriend
} from '../controllers/friend.controller';
import { authMiddleware } from '../middlewares/auth.middleware';

const router = Router();

router.use(authMiddleware);

router.post('/request', sendRequest); //发送好友请求
router.post('/accept', acceptRequest); //接受好友请求
router.get('/list', listFriends); //获取好友列表
router.get('/requests', listRequests); //获取好友请求列表
router.delete('/:id', removeFriend); //删除好友

export default router;
